/*
 * DatabaseHandler.h
 *
 *  Created on: 2010.08.21.
 *      Author: andris
 */

#ifndef DATABASEHANDLER_H_
#define DATABASEHANDLER_H_

#include <FBase.h>
#include <FUi.h>
#include <FIo.h>

class DatabaseHandler {
public:
	DatabaseHandler();
	virtual ~DatabaseHandler();
	result Construct();
	result Persist(Osp::Base::String newName,Osp::Base::String newPwd);
	result Remove(Osp::Base::String name);
	result Update();
	Osp::Io::DbEnumerator * getAllItems(bool sorrend);
	Osp::Io::DbEnumerator * getNItems(bool sorrend, int page, int rpp);


private:
	// db
	Osp::Io::Database * database;
	Osp::Io::DbEnumerator * enumerator;
	Osp::Io::DbStatement * statement;
	Osp::Base::String ** itemList;


};



#endif /* DATABASEHANDLER_H_ */
